package com.eling.elcms.travel.model;

import com.eling.elcms.core.dao.annotation.In;
import com.eling.elcms.core.model.BaseModel;
import com.eling.elcms.system.model.CommonUser;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.IndexedEmbedded;

import javax.persistence.*;
import java.util.Date;

/**
 * 报名退费
 * 
 * @author zhoulin
 *
 */
@Entity
@Table(name = "travel_signuprefund")
@Indexed
public class SignUpRefund extends BaseModel { 

	private static final long serialVersionUID = -6995441352140633411L;

	@Id
	@In
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@DocumentId
	private Long pkSignUpRefund;

	/** 报名收费 */
	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "pkSignUpCharge")
	@IndexedEmbedded(depth = 1)
	private SignUpCharge signUpCharge;

	/** 退费 */
	@Column
	@Field
	private Double refund;

	/** 退费人 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "pkOperator")
	@IndexedEmbedded(depth = 1)
	private CommonUser operator;

	/** 退费日期 */
	@Column
	@Field
	private Date refundDate;

	@Version
	private Integer version;

	public Long getPkSignUpRefund() {
		return pkSignUpRefund;
	}

	public void setPkSignUpRefund(Long pkSignUpRefund) {
		this.pkSignUpRefund = pkSignUpRefund;
	}

	public SignUpCharge getSignUpCharge() {
		return signUpCharge;
	}

	public void setSignUpCharge(SignUpCharge signUpCharge) {
		this.signUpCharge = signUpCharge;
	}

	public Double getRefund() {
		return refund;
	}

	public void setRefund(Double refund) {
		this.refund = refund;
	}

	public CommonUser getOperator() {
		return operator;
	}

	public void setOperator(CommonUser operator) {
		this.operator = operator;
	}


	public Date getRefundDate() {
		return refundDate;
	}

	public void setRefundDate(Date refundDate) {
		this.refundDate = refundDate;
	}

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

}
